package cn.ming.wfchat.app.me.activity.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.ming.wfchat.R;
import cn.ming.wfchat.app.me.activity.model.EarningsRecordBean;

/**
 * 收益记录
 */
public class EarningsRecordAdapter extends BaseQuickAdapter<EarningsRecordBean.CoinLogBean, BaseViewHolder> {

    public EarningsRecordAdapter(List<EarningsRecordBean.CoinLogBean> data) {
        super(R.layout.item_earning_record, data);
    }

    @Override
    protected void convert(BaseViewHolder helper,EarningsRecordBean.CoinLogBean item) {
        helper.setText(R.id.tv_timer, item.getCreateTime());
        TextView tv_amount = helper.getView(R.id.tv_amount);
        if (item.getAmount() > 0) {
            tv_amount.setTextColor(mContext.getResources().getColor(R.color.base_54C260));
            helper.setText(R.id.tv_amount, "+"+item.getAmount() + "FJ");
        } else {
            tv_amount.setTextColor(mContext.getResources().getColor(R.color.base_EA5668));
            helper.setText(R.id.tv_amount, item.getAmount() + "FJ");
        }

        helper.setText(R.id.tv_title, item.getLogEnumDesc());

    }
}
